package org.xdq.观察者模式2;

public class Test {

    public static void main(String[] args) {
        Goods g = new Goods();
        Security s = new Security();
        g.setSecurity(s);

        Thief t = new Thief();
        g.addObserver(t);
        s.addObserver(t);

        s.addObserver(new Police());

        g.steal();

    }
}
